<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
	$(function() {
		$("input[name=date]").datepicker();
	});

	function invoiceRadio1Ctr(radioObj) {
		if(radioObj.value > 0) {
			$("input[name=date]").attr("disabled", true);
			$("input[name=recipient]").attr("disabled", false);
		}else{
			$("input[name=date]").attr("disabled", false);
			$("input[name=recipient]").attr("disabled", true);
		}
	}
	
	function setDatePick(date) {
		$.ajax({
			url: "inputInvoiceNum_leftForDays.ga",
			type: "post",
			dataType: "html",
			data: {days: date},
			success: function(data) {
				$("#resultForDayLeft").html(data);
			},
			error: function() {
				alert("오류");
			}
		});
	}
</script>

</head>
<body>

<h2>송장번호 입력</h2>
<table style="background:#eeeeee;width:100%">
	<tr>
		<td width="30%">
			<input type="radio" name="invoiceRadio1" value="0" onclick="invoiceRadio1Ctr(this)"/>
			날짜선택 &nbsp;
			<input type="text" name="date" readonly disabled onchange="setDatePick(this.value)"/>
		</td>
		<td>
			<input type="radio" name="invoiceRadio1" value="1" onclick="invoiceRadio1Ctr(this)"/>
			수령인 명 &nbsp;
			<input type="text" name="recipient" disabled/>
		</td>
	</tr>
</table>

<div>
<div id="resultForDayLeft" style="width:10%;height:600px;float:left;"></div>
<div id="resultForDayRight" style="width:90%;float:right;"></div>
</div>

</body>
</html>